﻿@using LKVMLMADMIN.Models
@using LKVService
@{
    ViewBag.Title = "Cấu hình Website";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
}
@model WebsiteModel
<div id="wrapper">
    <div class="row">
        <div class="col-lg-12">
            <h3 class="page-header">@ViewBag.Title</h3>
        </div>
        <!-- /.col-lg-12 -->
    </div>
    <div class="row">
        <div class="col-lg-12">
            <div class="panel panel-default">
                <div class="panel-body">
                    <div class="row">
                        <div class="col-lg-9" style="margin-left:4% !important;">
                            @using (Html.BeginForm("WebSite", "CongCu", FormMethod.Post, new { @class = "login-form form-horizontal", enctype = "multipart/form-data" }))
                            {
                                <label style="color:orangered">@ViewBag.Notice</label>
                                <div class="form-group">
                                    <label>Logo:</label><br /><img src="@Model.LogoPath" class="img-thumbnail" height="170" width="200" />
                                </div>
                                <div class="form-group">
                                    <div id="file-uploader">
                                        <noscript>
                                            <p>
                                                Please enable JavaScript to use file uploader.
                                            </p>
                                            <!-- or put a simple form for upload here -->
                                        </noscript>
                                    </div>
                                </div>
                                @Html.HiddenFor(m => m.LogoPath, new { @Id = "pathImage" })
                                <div class="form-group">
                                    <label>Footer:</label>@Html.TextAreaFor(m => m.FooterWeb, new { @Value = Model.FooterWeb, Class = "form-control", @Id = "txtContent" })
                                </div>
                                <div class="form-group">
                                    <label>Title:</label>@Html.TextBoxFor(m => m.TitleWeb, new { @Value = Model.TitleWeb, Class = "form-control" })
                                </div>
                                <div class="form-group">
                                    <label>Theme:</label>@Html.DropDownListFor(m => m.ColorWeb, Model.Themes, new { Class = "form-control", @Style = "width:200px !important;" })
                                </div>
                                <div class="form-group ">
                                    <button type="submit" class="btn btn-default">Lưu</button>
                                    <button type="reset" class="btn btn-default">Thoát</button>
                                </div>
                            }
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    function UploadImage() {
        var uploader = new qq.FileUploader({
            element: document.getElementById('file-uploader'),
            action: '/CongCu/UploadFile',
            debug: true,
            multiple: false,
            allowedExtensions: ['png'],
            onComplete: function (id, fileName, response) {
                if (response.status == "success") {
                    $('#pathImage').attr("value", response.link);
                }
            }

        });
    }
    $(window).load(function () {
        UploadImage();
    });
</script>